builder-tool: Don't strip the xml declaration
authorMatthias Clasen <mclasen@redhat.com>
Thu, 28 Mar 2019 23:28:05 +0000 (19:28 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Thu, 28 Mar 2019 23:28:05 +0000 (19:28 -0400)
This is useful for interoperability with other tools.

gtk/tools/gtk-builder-tool-simplify.c

index 2c7f4e52cf03bbfa400c7180d8f41b317402576d..44f5f59e532bef32a9098a8261624b3e17b7128e 100644 (file)
@@ -1264,9 +1264,16 @@ dump_element (Element *element,
     g_fprintf (output, "/>\n"); 
 }
 
+static void
+write_xml_declaration (FILE *output)
+{
+  g_fprintf (output, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
+}
+
 static void
 dump_tree (MyParserData *data)
 {
+  write_xml_declaration (data->output);
   dump_element (data->root, data->output, 0);
 }